<?php
namespace backend\models;
use yii\db\ActiveRecord;

class Tags extends ActiveRecord{

    public static function tableName(){
        return '{{%tags}}';
    }

    public function rules(){
        return [
            ['tagname', 'required', 'message' => '标签名称不能为空'],
            ['weight', 'required', 'message' => '权重不能为空'],
            ['tagname', 'unique', 'message' => '该标签已经存在'],
        ];
    }

    public function attributeLabels(){
        return [
            'tagname' => '标签名称',
            'weight' => '权重'
        ];
    }
}

